<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header3.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">成果转化示范</div>
            <div class="center">

                <div class="org-info-box">
                    <div class="org-info-inner" id="title">
                        <img class="org-left-img" :src="
            dataMap.imgList[0]
              ? dataMap.imgList[0][0] == '/'
                ? baseURL + dataMap.imgList[0]
                : dataMap.imgList[0]
              : '../../../../src/assets/informition/real-default.png'
          " alt="暂无图片" />
                        <div class="org-info-right">
                            <div class="org-info-name">
                                <span>{{ dataMap.detail.name }}</span>
                                <!-- <div class="refer">立即咨询</div> -->
                            </div>
                            <div class="org-info-tag-box">
                                <div class="org-info-tag">
                                    <img src="../../../../../assets/serviceOrgDetail/icon4.png" alt="" />
                                    <span>机构类型：{{ dataMap.detail.orgClass }}</span>
                                </div>
                                <div class="org-info-tag">
                                    <img src="../../../../../assets/serviceOrgDetail/icon1.png" alt="" />
                                    <span>所在地点：{{ dataMap.detail.address }}</span>
                                </div>
                                <div class="org-info-tag">
                                    <img src="../../../../../assets/serviceOrgDetail/icon2.png" alt="" />
                                    <span>服务类型：{{ dataMap.detail.type || "暂无" }}</span>
                                </div>
                            </div>
                            <div class="org-info-tag-box">
                                <div class="org-info-tag">
                                    <img src="../../../../../assets/serviceOrgDetail/icon3.png" alt="" />
                                    <span>行业领域：{{ dataMap.detail.industry }}</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="container">
                    <div class="box-title" id="container">
                        <img src="../../../../../assets/serviceOrgDetail/icon5.png" alt="" />
                        <span>机构简介</span>
                    </div>
                    <div class="detail-text" v-html="dataMap.detail.content"></div>
                    <div class="box-title" id="image">
                        <img src="../../../../../assets/serviceOrgDetail/icon5.png" alt="" />
                        <span>机构图片</span>
                    </div>
                    <div class="swiper-box">
                        <a-carousel arrows>
                            <template #prevArrow>
                                <div class="custom-slick-arrow" style="left: 10px; z-index: 1">
                                    <left-circle-outlined />
                                </div>
                            </template>
                            <template #nextArrow>
                                <div class="custom-slick-arrow" style="right: 10px">
                                    <right-circle-outlined />
                                </div>
                            </template>
                            <div class="swiper-item" v-for="(item, index) in dataMap.imgList" :key="index">
                                <!-- <img :src="item" alt="" /> -->
                                <img :src="
                item
                  ? item[0] == '/'
                    ? baseURL + item
                    : item
                  : '../../../../src/assets/informition/real-default.png'
              " alt="暂无图片" />
                            </div>
                            <!-- <div class="swiper-item">
						<img src="https://img2.baidu.com/it/u=4101421395,1645510948&fm=253&fmt=auto&app=120&f=JPEG?w=890&h=500"
							alt="" />
					</div>
					<div class="swiper-item">
						<img src="https://img2.baidu.com/it/u=4101421395,1645510948&fm=253&fmt=auto&app=120&f=JPEG?w=890&h=500"
							alt="" />
					</div> -->
                        </a-carousel>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>


<script setup>
import moreBtn from "../../../../../components/more-btn.vue";
import headerBox from "../../../../../components/header.vue";
import headerImg from "../../../../../components/headerImg.vue";
import footerBox from "../../../../../components/footer-box.vue";
import { LeftCircleOutlined, RightCircleOutlined } from "@ant-design/icons-vue";
import { ref, reactive, onMounted, toRaw } from "vue";
import { putDemand } from "../../../../../api/globalSearch";
import { proofOfConceptList } from "../../../../../api/incubation";

import { useRouter, useRoute } from "vue-router";
import { getOrgDetail } from "../../../../../api/scientificResearch.js";
import { get, filter } from "lodash";
import axios from "axios";
const baseURL = axios.defaults.baseURL;
const router = useRouter();
const route = useRoute();
const list = ref({
    technologyList: [],
    personnelList: [],
});
// const baseURL = ref([]);
defineProps({
    id: {
        default: "",
    },
});
const wrapperStyle = ref({
    width: "20rem",
});
// 阻止点击的默认事件修改路由
function handleAnchorClick(e, link) {
    e.preventDefault();
    var srcolls = document.getElementById(link.href);
    srcolls.scrollIntoView({
        block: "start",
        behavior: "smooth",
    });
}

function toAdd() {
    router.push("addIntention");
}
const proofOfConceptData = ref([]);
function getProofOfConceptList() {
    proofOfConceptList({ field: dataMap.detail.industry }).then((res) => {
        console.log(res);
        if (res.code == 200) {
            proofOfConceptData.value = filter(
                get(res, "data.list", []),
                (item, index) => {
                    return index < 5;
                }
            );
        }
    });
}
function toDetail(item, type) {
    console.log(item.type, item.id);
    var url = "";
    if (type == 1) {
        //科技研发需求
        url = "/requirementDetail?id=" + item.id;
    }
    if (type == 2) {
        //科研人才需求
        url = "/requirementDetailOther?id=" + item.id;
        dataMap.id = item.id;
        getDetail();
    }
    if (type == 4) {
        url = "/verificationDetail?id=" + item.id;
    }
    router.push(url);
}

function getMatch() {
    putDemand({
        industry: dataMap.detail.industry,
    })
        .then((response) => {
            list.value = [];
            if (response.code == 200) {
                list.value = response.data;
            } else {
                list.value = [];
            }
        })
        .catch((err) => {
            list.value = [];
        });
}

const dataMap = reactive({
    id: "",
    detail: {},
    list: [],
    imgList: [],
});
const getDetail = async () => {
    await getOrgDetail(dataMap.id).then((res) => {
        dataMap.detail = res.data;
        dataMap.imgList = res.data.imgUrls.split(",");
        getMatch();
        // dataMap.detail.sTime = res.data.startTime.substring(0, 10)
        // dataMap.detail.eTime = res.data.endTime.substring(0, 10)
        // dataMap.detail.createTime = res.data.endTime.substring(0, 10)
    });
};
const gotoHome = (act) => {
    router.push({
        path: '/bigScreenIndex',
    })
}
const backToOne = (act) => {
    router.go(-1)
}

const goBack = () => {
    router.push('/chart')
}
onMounted(async () => {
    // console.log(id)
    dataMap.id = route.query.id;
    await getDetail();
    getProofOfConceptList();
});
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;

        .org-info-box {
            width: 100%;
            height: 24rem;
            background-size: cover;
            background-image: url(../../../assets/serviceOrgDetail.png);

            .org-info-inner {
                display: flex;
                align-items: center;
                width: 136rem;
                height: 100%;
                margin: 0 auto;
                padding: 0 10rem;

                .org-left-img {
                    width: 15rem;
                    height: 15rem;
                    border-radius: 50%;
                    margin-right: 3.7rem;
                    object-fit: cover;
                    color: #fff;
                }
            }

            .org-info-right {
                flex: 1;
                display: flex;
                flex-direction: column;
            }

            .org-info-name {
                display: flex;
                justify-content: left;
                align-items: center;
                font-size: 3.2rem;
                font-weight: bold;
                color: #fff;
                margin-bottom: 3rem;

                .refer {
                    width: 9rem;
                    height: 3rem;
                    border-radius: 4px;
                    background: #037aff;
                    color: #ffffff;
                    font-size: 1.6rem;
                    text-align: center;
                    line-height: 3rem;
                    margin-left: 4rem;
                    font-weight: normal;
                }
            }

            .org-info-tag-box {
                display: flex;
                align-items: center;
                margin-bottom: 2rem;
                color: #ffffff;

                .org-info-tag {
                    display: flex;
                    align-items: center;
                    margin-right: 2rem;

                    img {
                        width: 1.8rem;
                        height: auto;
                        margin-right: 1rem;
                    }
                }
            }
        }

        .pagination-box {
            width: 100%;
            height: 10rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .add-box {
            width: 136rem;
            height: 6.5rem;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #d8d8d8;

            .add-title {
                display: flex;
                align-items: center;
                font-size: 2.2rem;
                font-weight: bold;
                color: #000000;

                &::before {
                    content: "";
                    display: block;
                    width: 0.5rem;
                    height: 3rem;
                    background: #037aff;
                    margin-right: 1rem;
                }
            }

            .add-btn {
                width: 13rem;
                height: 4.5rem;
                text-align: center;
                line-height: calc(4.5rem - 4px);
                border-radius: 4px;
                border: 1px solid #037aff;
                font-size: 1.6rem;
                color: #037aff;
                cursor: pointer;
            }
        }

        .container {
            width: 136rem;
            margin: 0 auto;
            color: #fff;
            //   background-color: #ffffff;
        }

        .box-title {
            width: 100%;
            height: 6.5rem;
            padding: 0 2rem;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #4494ff46;

            img {
                width: 2.5rem;
                height: 2.5rem;
                margin-right: 1rem;
            }

            span {
                font-size: 1.8rem;
                color: #037aff;
                font-weight: bold;
            }
        }

        .detail-text {
            padding: 2rem 4rem;
            font-size: 1.6rem;
            color: #fff;
            text-indent: 2em;
        }
        .swiper-box {
            padding: 2rem;
            color: #fff;
        }

        .swiper-item {
            width: 100%;
            height: 50rem;
            color: #fff;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                color: #fff;
            }
        }
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    z-index: 10;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
</style>
